﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace Brain
{
    public static class CameraUtil
    {
        public static readonly float MinNearPlane = 0.000001f;

        public static readonly float DefaultFieldOfView = MathHelper.ToRadians(45);

        public static Matrix GetViewMatrix(Vector3 Position,
            Vector3 Target, Vector3 Up)
        {
            return Matrix.CreateLookAt(Position, Target, Up);
        }

        public static Matrix GetDefaultProjectionMatrix(float AspectRatio,
            float NearPlane, float FarPlane)
        {
            return Matrix.CreatePerspectiveFieldOfView(DefaultFieldOfView,
                AspectRatio, NearPlane, FarPlane);
        }

        public static Matrix GetProjectionMatrix(float FieldOfView, float AspectRatio,
            float NearPlane, float FarPlane)
        {
            return Matrix.CreatePerspectiveFieldOfView(FieldOfView,
                AspectRatio, NearPlane, FarPlane);
        }
    }
}
